package com.sina.weibo;

import android.app.Dialog;
import android.content.Intent;
import android.content.res.Resources;
import android.os.AsyncTask;
import android.os.Bundle;
import android.text.Editable;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.TextView;
import android.widget.Toast;
import com.sina.weibo.models.User;

public class WhitListDirect extends BaseActivity
  implements View.OnClickListener
{
  public static String KEY_WL_PASSWORD;
  public static String KEY_WL_USERNAME;
  private Button bnContinue;
  private EditText etNick;
  private Dialog mPgDialog;
  private FillInfoTask mTask;
  boolean mTaskFree = 1;
  private User mUser;
  private RadioGroup rgGender;
  private TextView tvPassword;
  private TextView tvUserName;

  public void doContinue()
  {
    String str1 = this.etNick.getText().toString();
    if ((this.etNick.getText() == null) || (this.etNick.getText().length() == 0))
    {
      String str2 = getResources().getString(2131427677);
      Toast.makeText(this, str2, 0).show();
      return;
    }
    if (this.rgGender.getCheckedRadioButtonId() == 2131624002);
    for (int i = 0; ; i = 1)
    {
      FillInfoTask localFillInfoTask1 = new FillInfoTask(null);
      this.mTask = localFillInfoTask1;
      FillInfoTask localFillInfoTask2 = this.mTask;
      Object[] arrayOfObject = new Object[2];
      arrayOfObject[0] = str1;
      Integer localInteger = new Integer(i);
      arrayOfObject[1] = localInteger;
      AsyncTask localAsyncTask = localFillInfoTask2.execute(arrayOfObject);
      break;
    }
  }

  protected void handleTitleBarEvent(int paramInt)
  {
  }

  public void onClick(View paramView)
  {
    Button localButton = this.bnContinue;
    if (paramView == localButton)
      doContinue();
  }

  protected void onCreate(Bundle paramBundle)
  {
    super.onCreate(paramBundle);
    setContentView(2130903096);
    User localUser = StaticInfo.mUser;
    this.mUser = localUser;
    EditText localEditText = (EditText)findViewById(2131624218);
    this.etNick = localEditText;
    RadioGroup localRadioGroup = (RadioGroup)findViewById(2131624001);
    this.rgGender = localRadioGroup;
    Button localButton = (Button)findViewById(2131624220);
    this.bnContinue = localButton;
    this.bnContinue.setOnClickListener(this);
    RadioButton localRadioButton1 = (RadioButton)findViewById(2131624002);
    RadioButton localRadioButton2 = (RadioButton)findViewById(2131624003);
    if ((int)(Math.random() * 1000.0D) % 2 == 0)
      localRadioButton1.toggle();
    while (true)
    {
      TextView localTextView1 = (TextView)findViewById(2131624104);
      this.tvUserName = localTextView1;
      TextView localTextView2 = (TextView)findViewById(2131624123);
      this.tvPassword = localTextView2;
      Intent localIntent = getIntent();
      TextView localTextView3 = this.tvPassword;
      String str1 = String.valueOf(this.tvPassword.getText().toString());
      StringBuilder localStringBuilder = new StringBuilder(str1);
      String str2 = KEY_WL_PASSWORD;
      String str3 = localIntent.getStringExtra(str2);
      String str4 = str3;
      localTextView3.setText(str4);
      return;
      localRadioButton2.toggle();
    }
  }

  protected void onResume()
  {
    super.onResume();
  }

  class FillInfoTask extends AsyncTask<Object, Void, Boolean>
  {
    String error;

    private FillInfoTask()
    {
    }

    protected Boolean doInBackground(Object[] paramArrayOfObject)
    {
      String str = (String)paramArrayOfObject[0];
      int i = ((Integer)paramArrayOfObject[1]).intValue();
      try
      {
        StaticInfo.mUser.nick = str;
        RPCHelper localRPCHelper = RPCHelper.getInstance(WhitListDirect.this.getApplication());
        User localUser = StaticInfo.mUser;
        boolean bool = localRPCHelper.editUserInfo(localUser, i, 1);
        Boolean localBoolean1 = Boolean.valueOf(1);
        localBoolean2 = localBoolean1;
        return localBoolean2;
      }
      catch (RPCHelper.HttpException localHttpException)
      {
        while (true)
          Boolean localBoolean2 = Boolean.valueOf(0);
      }
    }

    protected void onCancelled()
    {
      WhitListDirect.this.mTaskFree = 1;
    }

    protected void onPostExecute(Boolean paramBoolean)
    {
      WhitListDirect.this.mTaskFree = 1;
      WhitListDirect.this.mPgDialog.dismiss();
      if (paramBoolean.booleanValue())
      {
        Intent localIntent1 = new Intent();
        String str1 = WhitListDirect.this.etNick.getText().toString();
        Intent localIntent2 = localIntent1.putExtra("com.sina.weibo.RegisterActivity1.NICKNAME", str1);
        String str2 = StaticInfo.mPassword;
        Intent localIntent3 = localIntent1.putExtra("com.sina.weibo.RegisterActivity1.PASSWORD", str2);
        String str3 = StaticInfo.mUsername;
        Intent localIntent4 = localIntent1.putExtra("com.sina.weibo.RegisterActivity1.USRNAME", str3);
        WhitListDirect.this.setResult(-1, localIntent1);
        WhitListDirect.this.finish();
      }
      while (true)
      {
        return;
        if (this.error != null)
        {
          WhitListDirect localWhitListDirect1 = WhitListDirect.this;
          String str4 = this.error;
          Toast.makeText(localWhitListDirect1, str4, 0).show();
          continue;
        }
        WhitListDirect localWhitListDirect2 = WhitListDirect.this;
        String str5 = WhitListDirect.this.getString(2131427542);
        Toast.makeText(localWhitListDirect2, str5, 0).show();
      }
    }

    protected void onPreExecute()
    {
      WhitListDirect.this.mTaskFree = 0;
      WhitListDirect localWhitListDirect1 = WhitListDirect.this;
      WhitListDirect localWhitListDirect2 = WhitListDirect.this;
      Dialog localDialog1 = Utils.createProgressDialog(2131427540, localWhitListDirect2, 1);
      localWhitListDirect1.mPgDialog = localDialog1;
      WhitListDirect.this.mPgDialog.show();
      Dialog localDialog2 = WhitListDirect.this.mPgDialog;
      WhitListDirect.FillInfoTask.1 local1 = new WhitListDirect.FillInfoTask.1(this);
      localDialog2.setOnKeyListener(local1);
    }

    protected void onProgressUpdate(Void[] paramArrayOfVoid)
    {
    }
  }
}

/* Location:           D:\Program Files\eclipse\apktool-r01-3\新浪微博\classes.dex.dex2jar.jar
 * Qualified Name:     com.sina.weibo.WhitListDirect
 * JD-Core Version:    0.6.0
 */